﻿using System;
using System.Drawing;


namespace AMSInventoryWeb.UserControls
{
    public partial class CalendarCtl : System.Web.UI.UserControl
    {
        public Color BackColor
        {
            get { return txtCalendar.BackColor; }
            set { txtCalendar.BackColor = value; }
        }

        private void SetDefaultVal()
        {
            if(txtCalendar.Text.Length == 0)
            {
                txtCalendar.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
        }
        public string Text
        {
            get {
                SetDefaultVal();
                return txtCalendar.Text; 
            }
            set {
                txtCalendar.Text = value;
                SetDefaultVal();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                SetDefaultVal();
        }
    }
}